Added functional tests and got carried away

Also added a shitload of angular stuff