Add some raw submodule bindings
Fix use-after-free in loading submodules