Features/threads

Thread adaptor and javascript protobuf implementation