prevent default when deleting from the beginning or end

Check whether an empty block is preceded (in the case of backspace) or
followed (for delete) by another block, and prevent event bubbling if
this is the case.

Also minor tidying of the demo page.