Use warnings.warn to print warnings

Since the library can be used by command line utilities whose
output could be piped.
Merge pull request #8 from lu-zero/master

Use warnings.warn to print warnings