Adding selection support

The multiple commits are caused by me uploading code via Github. I will rebase it all before I merge. 
I've named it Current file. I don't want to use document since it is not a document as such.