Added code for track function in Invariants class
Cleaner implementation of bonsaikon.py