refactored the global events object in smartmeter.js into smr...
now with mocha tests and many rafactored methods