Moved all CBot functions into a separate class