Fix encoding of const(dchar*), Improve cross-compiler support, refactored code, add few more functions