Model validation

Added partial model validation. Want to merge with master.