Move some code out of the Apiable module to make it includable for non-controllers.