Use ISafeSerializationData to fix problems using the library in medium trust environments (fixes #120)