Add models

This moves the generic model, attribute, and collection classes into a more central location, and also updates monitoring commands to take advantage of this.