Added transform method

Applies fn on context based on path