A simple javascript command router