Cleaned up some of the sql queries. Also added a way to show the line processessing speed using a background job