Fixed bug with URL discovery where non absolute resources were being discarded. Corrected issue with URL generation and missing port data. Cleaning up code a bit - trying to ensure it all wraps at 80 chars. Fixed doco and bumped npm version.