Several improvements

Added a new custom filter and added a less hacky check for uniqueness in
the models.