Fix to compare the versions with rc tags and unit tests for that.

Fixed the versions comparing functionality to consider the extra tags (rc or beta) in the npm versions and handle them elegantly.
Added Unit tests for them.