Added a testmode setter

This allows us to controle test/production environment from outside this class