Minor updates to give more flexibility

Added support for passing a string or function for path.
Added support for matching a path with query params.