Remove kruft and add tests