Testing

Added tests to previously untested code.

Need to stick to TDD methodology and not get carried away with trying to
implement functionality that is buggy and inconsistent.