Rearranged some of the functions to be a bit more modular. Added a free() function to gracefully release memory when the program is terminated. Made parse_read_buffer take a remainder pointer instead of returning the number of bytes left over. Made the bot context global to facilitate future external reference