Big update

Adding dimensions, triggers, speeding up querying