Fixed issue where global view variables override local in partials
Added partial function to api, to allow partials to be ajaxed
Added JS trait, Move trait init out of before(), reference view in controller