Move into namespace and use internal types.

Rather than using arrays for variables and lists, use internal classes
of Variable and Cons instead.