Added a function for the cleanup of test chains so the cleanup commands can be called from several places where cleaning is needed. Partly based on pull request #18 which also adds extra cleanup code...