Initial contribution

xbuild and xpersist work for simple entities