unit tests and guard method

added some unit tests and a guard method so you can spell check if your
not connect to a database and you didnt select anything to spell check
aginst