return instead of print stats, and more tests

Every function in missing.py (other than the filewriting function)
now returns or yields instead of printing, which makes this more
MVC-y and better for the webappification. Also added tests that
currently pass and improved tests by removing unnecessary
filewriting and filereading steps.