imdb: fix this to work again

Kind of typical that I did the last real change to this script about 6
years ago, and now lack of comments hurts. Add some comments at least
for the changed parts as well.
imdb: adapt to pep8, add author and license