Add debug output and angularjs tests