Fix: Resolve() does not merge the path w/ empty base path (#19176)

Net_URL2 did not merge the path if the base path was empty. This has
been fixed.

The issue was reported as Pear Bug #19176 on 2011-12-31 02:07 UTC.

Steps done:

- Add Test 19176
- Fixed Pear Bug #19176 in class Net_Url2 resolve() method
Fix: removeDotSegments("0") not working (#19315)

Net_URL2 was not able to properly apply the removeDotSegments()
method on a string that consisted only of the single Unicode
Character 'DIGIT ZERO' (U+0030) in US-ASCII (RFC 20) binary
octet encoding.

The issue was reported as Pear Bug #19315 on 2012-03-04 04:18 UTC.

Steps done:

- Add Test 19315
- Fixed Pear Bug #19315 in class Net_Url2 removeDotSegments() method
Dead Code Removal
Whitespace Fixes
Package.xml preparation.
Maintain Pear Coding Standard in class Net_URL2

- According to PHPCS Pear Coding Standard
- Fixed typos
- Fixed PHP Code Inspections (PHPStorm)
Removed superfluous data

Removed duplicated array key/value pair.

- Not the first example data anyway (RFC 3986, section 5.4)
Rest of the code using single quotes

Rest of the code used single quotes, but not every rest of the
code. This has been fixed now.

- Single quotes are used in code
- Double quotes are used in comments
Fix: Remove preg_replace /e modifier

Since longer in PHP trunk and then with upcomming PHP 5.5, the
preg_replace() /e modifier is deprecated. Instead, the
preg_replace_callback() function is used.

- Add test for normalize() method which is subject to changes
- Added private _normalizeCallback method
- Changed preg_replace() to preg_replace_callback()
Fix: URL normalization not as in RFC 3986

Net_URL2 did not properly address URL normilization as
outlined in RFC 3986 Section 6.

The normalize() method had two missing rungs in the
comparison ladder:

Percent-Encoding Normalization (6.2.2.2.) was not
addressed with the result that percent-encoded octets
that do not require percent-encoding were not normalized
to their unreserved character.

Scheme-Based Normalization (6.2.3.) was broken for the
default port in form of an empty string. This flaw was
the result of a missing string check.

These two issues are adressed with these fixes.

Steps done:

- Test extended with examples from RFC 3986 Section 6
- Fixed percent encoding in class Net_Url2 _normalizeCallback() method
- Fixed missing type-check in class Net_Url2 normalize() method
- Improved by using an array instead of foreach'ing over it
- Typo fixed; RFC number is 3986 (previously wrongly 3886)
- WS Fixed
Merge pull request #1 from ktomk/pear-patch-2

Fix Pear Bugs #19315 & #19176