added some tests for model and notifier, fixed some bugs