moved encode logics to encoder.go
changed handling Any of StringAttr
support for formatted string