Add wstring support Generalize metadata and get rid of the last straggling code that is specific to our system.