Various improvements and rootscope decoupling
Update tests
Update build