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

This reverts commit 64d888533b3432e9ed4db524cae3754337ab1c5d.