Currently script.{h,cpp} defines both a core data structure (CScript, and its associated opcodes) with serializations, and several sets of utlity code related to it (signing, verification, identification).
I believe these should be separated, so with all the modularlization efforts, the core data structures can go in a common library that does not pull in keystore, for example (which pulls in key, crypto code, ...).
Related, the abstract CKeyStore class should probably move to the new place where signing ends up, while the implementations can stay in keystore. This breaks the cyclic dependency between keystore and script.