Moved helper functions from helpers.php.
Fixed some errors and changed calls so they use ADbHelper class.