Added npm test running using jasmine-node spe/
Minor code tidy ups