Make Pcompress functionality into a library - initial changes.