Create cdbfunctions.py

This file is still in early testing stages. Many edits and additions to follow soon.