PMC: refactoring serialization impl to use polymorphic archive

The boost polymorphic archive is probably the correct way to do this.

Now the type exporting is done inside of a cpp in the library.