unified ReferencedXXX and DetachedXXX. Moroever, simplified the implementation of DetachedXXX -- each XXX has two constructors only. basic and easy to use. Added DetachedFactory which handles all the detaching of elements accoringly. Fixed #152