Code review comments; moved out JS to knapsack.js