Inject before_filter methods to ActionController::Base

This pull request adds some hackery to how `login_required` is called. This was done so that `login_required` is reachable inside Rails engines.