Merged modifications from QT

Recreated serialization layer code, it was lost by git gewurschtel.