Rework server side diff code

Prevents AJAX loading attempts if they are just going to fail anyway,
or arne't ever going to have a diff (too many paths || nothing to compare)

Add a couple of braces

Change-Id: I2dd18b22ad9252cd143d04432e6ccb404afe92a3