Add elapsed time collection. Close #4

Fix jshint warnings for latest jshint, add jsdoc.