Java project: managing a system of commands