Js refactor

Pulls the business logic out of the controller and into a utility class

Ha ha. Whatever. Jelly has a package under controller called "helpers". But I don't care. As long as there are not in the utils package.