Optimize memcpy assembler function, fix and simply exceptions

Some additional optimizations are added to the memcpy function
in copy_template.S. Also, the broken fixup code to handle page
exceptions is simplified and corrected (although it has not yet
been fully tested). Also add some more comments.