Implemented an autocommit feature in the database connection functions

Simply set the autocommit field to how often (queries) it should
automatically commit. You can still manually commit after doing this
but this is not recommended. No matter what this value is it will
automatically commit when it is idle anyway.

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>