cleaned up data handling
now separated message parsing from message handling, cleaned up database added type, message_id and auto_increment id columns