Add count method support to the model

This is related to Issue #20.