Added dynamic loading directive, and the Resource service that makes it work