Fixed some breaking tests and modified the tracking js to work with the new JS object structure - needs testing.