add a very basic state registry for objects
change format of lib/index.js