Automatic dependency resolution for Javascript