Reorganize module structure to make embedding easier.