fixed error in onmatch, added nose tests in tests.py
added token matrix for onmatch rule