Complete isRotation, refactor other modules

Keep module.exports at top of file