Added matrix_functions for tests
Clean up

dicts of calculated matrices
various clean-ups
starting tests