some code quality cleanup.

do to some report of static analysis tool, unused variable (mainly that)
a few function re-declarations, a python2 print statement...

cf https://www.codacy.com/public/bussonniermatthias/ipython/issues
I think I'm OK with the braces-less `if` so long as it's reasonable to put it all on one line (as these were). If the action is going on a new line, I'd put the braces in.

We are, however, generally relaxed about people writing code in slightly different styles, and I think it's fine to continue that with the JS.