Table-based K-factors, fixes #1

Also fixed jsdoc comments
Also added jshint for test files