Add SSL code to bot; add tests for event system. All WIP.