Added an rm() api function to remove items from a class.

Updated init() to set the trap_exit process_flag so terminate() gets called