Rewrite the submodule logic again.

To avoid issues of unneccesary modules in save file.