Add ability to set global connection

Add base model class