Refactor the legacy Core auth method to use the AuthorizationMethod class.

Signed-off-by: Tyler O'Meara <Tyler@TylerOMeara.com>
Add AuthMethod support to API calls.

Adds 2 new methods to the AuthorizationMethod interface: before_api and
after_api. These are analagous to the __before__ and __after__ calls in
SignedController that was used previously, though with some of the
common code abstracted out. This enables AuthorizationMethods to
validate API requests according to their standards, as well as modify
any responses before they're sent. In order to support this, a keyword
argument 'auth_method' was added; it defaults to the legacy Core
authorization scheme for backwards compatability reasons, and is
removed from the keyword arguments before the actual API call is made.

Signed-off-by: Tyler O'Meara <Tyler@TylerOMeara.com>