Blob stream conformance

• Numerous fixes to make PGBlob compliant with spec
• Migrated unit tests from original project