Rewriting an old PHP app with Angular.js