Improved docs.
Added tests for codebase, added docstrings.
Refactor.
Refactored machine file.