Renaming and fixing js bugs. Preparing for integration tests