Make Controller#beforeAction function. (╯°□°）╯︵ ┻━┻)

Closes gh-517.

I love removing code.