Execute beforeAction in controller context. Closes gh-546.