Reworked code-base to be cleaner, set up for AMD, support for parent-child controller, and documentation