Make Utf16CodeUnits generic and give it a public constructor.

This allows encoding to UTF-16 something that is not in UTF-8, e.g. a `[char]` UTF-32 string.

This might help with servo/servo#4023