Add date type. Tidy project organisation and tweak some tests