Execution of the nit code on another thread, and redefinition of basic input and output methods

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>
Updated the example for pnacl, to make it work with the threading update

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>