Implements the #has Block helper

closes #2115
- Added new #has block helper
- Added several tests for #has helper

kudos to @s0x for some crazy JS-fu