Correctly set type and serialize correct value for References

Conflicts:
	CHANGELOG.md
changing the type is supported by setting a value of a different type: https://github.com/phpcr/phpcr-api-tests/blob/master/tests/10_Writing/SetPropertyDynamicRebindingTest.php

the idea is indeed that setting a value of a different type changes the type of the property. setValue has an optional $type argument for the type constant, to force a specific type.