Added an exception to loglikelihood.py and two functions to model.py

I guess the expection is killing the program
The functions in model are readFromFile and saveToFile
In readFromFile we may need to check if the return is a model class