Modified to make compatible with python 3

Had to make two changes for compatibility:

1) Instead of Popen(...).stdout.read() I now use
Popen(...).communicate() as is suggested by the docs. Also decode() the
result with UTF-8 since it seems that they changed the lib to return
binary data instead of a string.

2) Changed lambda expressions to not have parenthesis around parameter
list. Apparently that is now allowed in python 3.

I'm actually not sure if either of these changes will break
compatibility with pything 2.X.