PEP8ified and added is_running method.

It seems like a rather vigorous rewrite, but this is the result of indenting differences with the PEP8 standard.