split the data model from main/

the model is moved to lib/common.py

probably a better place is model/*.py but let's leave it as is for
now.