Implement and assert on command mapping.

So that command functions may be lazily loaded as they are encountered.
This is enabled by setting the dir property of the command object to a
directory.

This has the benefit that only commands encountered are loaded on
program execution and adds a level of convention for declaring command
action handlers.