Layer up libraries when building from dictionary

First we start off with a base library, this contains just base, name
and definition. This appears to be enough to start with. We can use
these three definitions to build the core, and then the core to build
messages, and then messages to build final.

AFAICT, we can discard the previous library when we move on to the next
stage, after we build core we discard the base library, after we build
messages we can discard the core library, and after final we can discard
the message library. We then return the final library and the client
should be able to send messages from this.