Improve test support

* Add some documentation
* All values are checked depending on their types
* Do not compute Python output if check_output is False
* Do not hide misspelling in spec parsing for tests
* Accept '#runas' and '# runas' (like for export) (pep8)
* PEP8