Directly executable mate.py, cache reset option, small refactoring