Stationarity and extremum principles in mechanics