Add preliminary tests for middleware module - issue #3
Fix a typo and add verbosity option - close issue #3