Start to tidy the code into project format. Move written doc to WRITING repo