You can do that using a custom key binding in ~/Library/KeyBindings.
Firefox ignores this and still insists on home/end working on the full document. But even worse: in the new Gmail compose window, not even Command-Left/Right works (it does in other Textareas - no idea what Google did here).
Now this might totally be a case of http://xkcd.com/1172/ but by the life of me, I cannot work without a way to move the cursor to the beginning of a line - especially when the keys that I usually use are so destructive (scrolling all the way to the top, making me lose my position).
This is the only reason why using Firefox is out of the question.
In the past, I patched some JS file inside the bundle, but now that Firefox updates so often and it's a signed binary, I can't really do that any more.