[WIP] Add command callback table support

This PR targets #365. It is WIP but I'm ready for review here.
This will segfault if no function was found.