added basic dependent/dependency tracking
Major reshuffling in preparation for ScalaJS; tests pass