Moved some of the more general functions to a shared file

CodeViewer/basic.php contained some functions that could be useful for
the rest of the projects as well (such as database connection and
query code).
Split basic.php up into smaller parts

The following changes have been made in Shared/
Database functions have been moved to database.php.
Login related code has been moved to sessions.php
course-related functions have been moved to courses.php
Merge pull request #30 from HGustavs/duggasys-extract-basic

Move some of the common functionality from CodeViewer/basic.php