Implement the javascript command engine