TST: Added some granular tests, including test of 'memory' that currently fails.
PEP8 cleanup
minor tweak to test
Merge of memory bug fix from master branch (7639d2c)
Minor cleanup of merged version