Completed work on SQL interface

and merged all into Main (might change someday)