Removed unused import
Finished implementation of generalizations and specializations.

But heavy refactoring is pending. As usual, I'm committing so that I can continue working from another computer.
Removed duplication of fixture.
Rearranged validating functions and exceptions to improve abstraction.