Clean up main.js. Add offsetDirection to _createNewViewSequence