encoding: added Replacement identifier and htmlindex tests

Adding the replacement type is useful for being able to roundtrip.
Albeit not strictly necessary, it makes the tests a bit nicer and
probably other things as well.

Change-Id: Ic85fb85cefa6116e64afb0b44923f878036592db
Reviewed-on: https://go-review.googlesource.com/17804
Reviewed-by: Andy Balholm <andy@balholm.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
4 files changed