Prototyping Concurrent Systems with Agents and Artifacts: Framework and Core Calculus