Rename test.js to model_tests.js
uOptimization for fun

- lookup row once instead of 3 times
- replace magic numbers with constants
- don't hard code loop length