How can I define a custom object/class, but also for it to have an indexer, so that I can get values via something like this.

Code:
var value = group1["bob"]; //return a person class, for example
var planet = System[2] || System["Earth"]
It works much like this.

Code:
myForm["username"].value