- added singleton
Fixed singleton to cater for Interactive process

The singleton will call dispose on itself (if IDisposable is
implemented) for user interactive process (console/window) or assembly
process.