Changed to dynamically inserting namespace prefix if running in a
managed context.  Upgraded to api 31.0