Add model for messages

Also add support for 'or' filter, which is needed for
finding messages