added missing free() call in core shutdown function
unregister shutdown function after it was executed
check if the shutdown function exists, before executing
added missing header
Internal encoding must be changeable

Added macro for changing internal encoding as easy as possible.
the func-ptr-loader function does not have to return the module ptr