Add angular tests helper, support instant resolve of promises
Add tests for StateService