Issue/1007: Corrected the behaviour of the HOME and END keys on the Code...

This fix corrects the behaviour on the HOME and END keys in Firefox. There still seems to be an issue with the END key in Chromium on Ubuntu but I think that might be related to rendering issues in Chromium.

#1007