Javascript synchronous dependency resolver.