fetch theme specific Javascript
refactored javascript and some minor cleaning
repaired unit tests
refactored javascript and some minor cleaning