Don't assume presence of ApplicationController for anonymous controllers.

Apparently some of our developers don't have a root `ApplicationController` so
let's check for it's presence and use `ActionController::Base` when it's not 
around. Should fix #922.