Changed nowThreshold
Introduced SQL generator and materialized views, slight table mods.