fixing readDirectory

readDirectory didn't take into account files opened with an
MFileOpenHook. Changed and implemented the listing of NPK'd files
Updating Script API

Adding some Editor and Player-only script functions
- Editor implements isEditor() (== true) and a number of packaging
functions for use with publishing
- Player implements isEditor() (==false)

Added callbacks for ::publish() and ::updateEditor() in MGame as they
will be needed for plugins to work properly.

Added parse function to MScript to add a script from a buffer to the
state.

Added getters for the CFunctions within MScript so that if the
MScriptContext is replaced (ie by MScriptExt, or possibly by a non-lua
context) then can easily copy the functions to the new context.