Add support for building on Node 0.11+
Add test to check length of domains array matches num_domains