Make resolver filename aware

This allows a resolver to take the filename of the currently processed file into account.
Backward compatibility: If the function takes 1 parameter (above), call with value, expect a return value (since there's no callback); if it takes two, pass just the value, last parameter is the callback; if it takes more (new interface!), pass it the value, the filename being processed, and the callback.