Cleaned up linked lists, added unit tests and documentation.