Change import _np_utils to explicit relative import
Use simple count function instead of collections.Counter (not in 2.6)
Test for masked key elements and add various exception tests