use sets for uniqueness (reduces computation time)
Merge pull request #82 from dimagi/unique-filter

use sets for uniqueness (reduces computation time)