delete_framework() can be called with None or without argument

This will simplify the cleanup process as only one framework can run at a time
Tests now use FrameworkFactory.delete_framework()

This avoids "Framework already exists" exception after a test has failed
Add missing methods to ShellSession: flush and write
Use a default session if none is given in Shell.execute()
Corrected shell tests to use the new API
Corrected dict generation for Python 2.6 compatibility