A Modular Agent-Based Environment for Studying Stock Markets