Print replaced by logging in optimization and packaged_dependencies folders

Continuation of the pull request #718 for issue #41.

I didn't replace prints in the file packaged_dependencies/theano_linear/unshared_conv/unshared_conv.py as there kind of comments.