A simple JS command pattern.