[tools] use unicode_literals

This fixes an issue which prevented usage of unicode strings in commands()

Fixes #517
[ipython] Make ipython work for Python 3 as well

Account for an ipython3 quirk that makes it require unwrapped stdout/stderr for
the import as well.