Added model/schema support and minor bug fixes