Various changes and basic class hierarchy.