add Database class and other related classes
make use of Database class in test listener
use database class in model
refactor __call in model making it more clear