ticket:6 Fixed javascript, added tests
Merge branch 't6_ajax'