Tidying and refactoring

Also updated README