Restructure, Rename of class.php. Added .gitignore

Renamed class.php to DatabaseConnection.php to make more sense. Minor code
formatting and CamelCase-ing of the functions inside alongwith comments.

Added .gitignore to ignore any useless files from being tracked by git, e.g:
useless .class and .project file generated by IDEs.