Revert "Make reference a string with the limitation that it cannot contain invalid filename chars."

This reverts commit d0de4c6ffb8cf4b94c4b40d944f2b6cbc7633332.