Added subdirectory editable option, small refactoring.

- Small refactoring on pip/req.py.
- Added _strip_postfix, _build_req_from_url, _build_editable_options functions.
- Added test for install a package from a subdirectory.