Fixed singleton/not singleton support and implemented read only definitions.
Committing work in progress tests and specs.