Reorganized the code to fix #6
Merge branch 'master' of github.com:jacklund/btle.js