AngularJS project for reformatting input according to rules and a template