Move API and draft implementation of moduleloader