Speed improvements (yay), preparation for a neater, modularised codebase