Refactored everything to not require Sails as a global.