Added TSLog and needed changes
Added type-safe factory methods; removed PublicElemType so as not to mix it up with the actual template parameters