Move lib to package

I added package setting and document in README.md.
It keeps backward compatible for command line.