Initial working refactor of angular scripts

Redoing the way we use angular... Unit tests passing now.