Cleanup

Performed some basic cleanup and switched over to codecvt.