tiny js callback refactorings
Merge pull request #6 from liip/js_callbacks

tiny js callback refactorings