Reorganise requires between files, update docs, improve indentation when refactoring.