Test/integration test js login

This pull request builds upon changes made in #50. Please merge that one first.