Entities refactoring

Refactoring STS Basic entities into cleaner interfaces. I've not done extensive testing with the rest of the system, but these changes shouldn't break STS.

This is clean branch based on entities_refactoring branch