Added an API module for controlling the bot.

Also moved the bot record data out of process states. It's only stored
in Mnesia now and is requested when needed. I'm not quite sure if
that's the right way to go about it, but time will tell.