coding style fixes
Added extra testing, also set arguments as string
bugfix, fix headers merging
messed up tabs vs spaces reindented with spaces
Reindent switch statements
Merge pull request #3 from mjrider/fixes

bugfix and a load of code cleanups