Big refactor to handle subresources more generically; added more logic around permissioning
Generalized the notion of url generation for subresources