Added py-lib/tools.py for common tools used by all modules