Refactor links writer to use Transformer for all serialisation