Added shutdown for proper handling of System lifecycle.

Also added the proper code to setup and shutdown a system in the test
suites