Remove obsolete code and rearrange directories.