Style improvements thanks to @nigelsmall

More pythonic code, thanks Nigel!
Works against Neo4j on Heroku.