Initial groundwork for commodities being laid now

Also includes further refinements to javascript.