Improvements to code to implement classification of individual test items.
Style changes to better follow python style guidelines (PEP8).