php-weasel-30 Support for marshalling to/from primitive types/arrays

writeString now supports marshalling of pretty much any type.
It takes an optional type parameter, without which it will try to guess the type it should serialize as.
Type guessing is probably slow, unreliable when faced with complex array structures, but will be fine in the majority is simple cases.