Implemented the module system.

Also completely rewrote message parsing.

I really need to stop doing so many things in one commit.