Updated JQueryUIDialog to use JSOptionBuilder

Also, fixed a crucial bug in JSOptionBuilder.