switch from GPL to BSD
use versatile /usr/bin/env python hashbang

note that the problem with the hashbang and the reason it needed to be terminated by "#" was the windows EOL.
use logging and fix style
switch from CFLF to LF

note that this was causing the mysterious errors with the hasbang.