Added support for dynamic menu options.

The menu and input elements are now built using an options object array.