Initial commit
Add library files.
Fix some bugs.