Major refactoring, using promises
Merge branch 'refactoring' of http://www.github.com/wgoldie/chatsnap into refactoring