Addressed code review issues, added tests for java and javascript.