Some cleanups in stats

Playing with PyCharm, may as well get it to do something semi-useful....

This is mainly:

- PEP8 fixes
- changes in docstrings (imports) to conform to numpy doc standard
- removing extraneous parenthesis
- changing to in-place operations where possible

According to PEP8, "The preferred place to break around a binary operator is after the operator, not before it.".  In this case, however, moving `%` to the previous line puts it in column 80, so I guess this is OK as is.