A Software Architecture for Intelligent Virtual Environments Applied to Education