Some progress

Also, some corrections
New file
Changed variable names in order to reduce chance of mistakes
New file
New file
New file
Small improvements
Many changes; almost finished
New file
Just standardized SQL calls
Small changes
Merge remote-tracking branch 'origin/master'

Conflicts: