Changed from PDO access of database to mysql. Created view files for most of the functions.