move commands to a plugin; use sub-expressions to extract parts of a URI