the commands dict is no longer global and is no longer ment to be imported by users, and minor code cleanup