Add support for copying whole lines, mapped to Cmd-C

Once again mimicking Sublime's behaviour. I also used the opportunity to refactor the code a tiny little bit.