added utf8 validation. fixed multi-threading / locking bugs. added ability to set stack size. added listen function. more cleanup