Code cleanup

Merged ListViewNF with LVSorter, and separated the SQL class into three
distinct areas of responsibility