Adding selection support

The multiple commits are caused by me uploading code via Github. I will rebase it all before I merge. 
Hm, What about naming  the variable/identifier _current document_ instead of _whole file_?