Moved bot mechanics in to own file, fixed some bugs