Add base class factory function

Summary: base factory function and a GET factory function that works with a base as it's first argument

Test Plan:
created a base as '/admin' with some middleware and a required query parameter.
created 2 endpoints using this base. tested the 2 endpoints with the base requirements

Reviewers: dougli, SeanDunford, steph, YassineA

Reviewed By: dougli

Differential Revision: http://phabricator.palinka.me/D1660