minor AI update

minor AI update and separated jquery UI callbacks into their own library