Update code documentation.
Fix spec test
Fix spec test
Complete implementation of extend and extendAsNew.
Update API documentation.