Angular fixes and cleanup

Clean up angularjs code, make it more usable, add directives where needed. Start implementing api to communicate better with angular