Cleaned the structure and added proper php-doc.
Added function to get last inserted id from db class.