Tidied up again, docstrings, split out keyfile class