Committing all updates to version 2.0

Major revisions from version 1 to make this more stable and general.