Cleanup terrain.js
Updated loading order