Added tests, cleaned up linked list code