Moved some basics to "tools.py", which will be added to this directory.