Main library initial commit

Added files from main library.
Need to clean, comment, document, and test.