Refactored front.js a bit - notably, took out all of the pointless 'then' clauses.