Add support for overriding main function

This pull request adds the option to define the scripts' main function (the one handled by default by ```__run```, IIRC).

This option comes handy when you have developed a script and it already handles options and such, and you want your script to handle them.