Separated out validator code into its own JS file. Added should expecations