Cleaned up spellbook handling code, fixes 1699962.

Also fixed a bad bug with spell validity (good thing that spellbooks 1-4 are long, huh…)

git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1300 c06c8d41-db1a-0410-9941-cceddc491573

Created by  haranp  on April 13, 2007
25VJTGR3AWZJ7OHKYWS53VJ6TVMMU6UT7BA6V3QVVWDGI6FYKD7QC
Change contents