Make single entry template use original entry ID

In the event of an update, the template was using the current entry ID
which was making client-side management of updates impossible. Added an
"original_entry_id" field that is either the ID of the entry that is to
be replaced or the current ID if no replacement is taking place.