Add hasChildren() function with specs

Add a simple function hasChildren()

Used it in one of my projects - thought I would share.

Thanks!