Rearranged & renamed code & added error handling

To improve performance, changed searches by attribute to class for
input elements.  Changed event handler functions from anonymous to
named so I could remove it when game is won.  Added error checking to
make sure grid is properly formatted and present.  Sudoku can now be
initialized with an array of strings or jQuery collection of inputs.