Added the insert favorites function, and moved the connection for the database to the constructor so we don't need to keep adding it every function.