Clean up source, add first test.