Simplified Resolve() function, migrated some logic to PathContext
lint common.js