Add linting, re-indent files and reorganise tests