Fixed #21

Also cleaned up the joinmsg plugin and made it a little more public
friendly.