Tidy tests. Add linting, code checks and update structure.