Fix awc, gp, and block filtering in HSR

http://manage.dimagi.com/default.asp?135118
https://github.com/dimagi/commcare-hq/pull/4340 contains a fair bit of duplicated logic, so I pulled that out.  Additionally, the block filtering suffered from the same fault as gp and awc, so I've applied that logic there as well.
@czue @agrzywinski @lwyszomi