AC-FOVE: Code refactoring

* Constraint, Term and Substitution

There are some unchecked casts due to refactoring that must be
reviewed later.