Minor code cleanup.

Moved the callbacks for bower and npm repos into their own functions.
This moved a bunch of code out of a switch statement, which was getting
difficult to read.

This also eliminted a level of indentation in preparation for another
change.
Fixes #1: checks that version is a valid semver.
Fixed issue introduced by code refactoring.
Merge pull request #3 from djensen47/master

Pull request to fix Issue #1