Fix issue 101

According to the discussion on the issue #101, I implemented a fix, extended the test case for the required validator and adjusted the hasValue function to check for empty arrays.

In order to build the project I fixed the versions of the node dependencies to its original values.

So please review the changes and if they are ok then release a new version maybe. 

Thanks, Oleg