fixed #60
added a test for the  singleton restriction and fixed its implementation
fixed some container related bugs and added a container test
fixed userRef writing function type and code generation
Merge remote-tracking branch 'upstream/master'