Refactored sqlpyzer marshalling code.