Better logging (though not perfect, still double messages)
Ignore compiled python files
Use cPickle instead of pickle and add write type argument