Improve mapping for more functions.

I moved the module definition to its own file because I think it's more convenient.
You need to free the commit here, right? Maybe close the repo too?