Replace print statements with logging using mozlog

@whimboo 
This is to fix #26 
I think we should be catching OSError here. Your thoughts? @whimboo