Clean up code, make tests run