Rewrite an absolute ton of Angular and REST code

This change rewrites a good portion of Angular REST service code, along with the corresponding Java service code. The JSON for each request is also now documented.
Surely you mean function PermissionSet(template)