Refactor code

Fixes #19.
Just saw your comment about the unwritten jQuery convention :) - we can go with that but it might no be in our interested do adopt conventions to project types of same language.