Template: Base lib, updated extend method to handle deep clonning.