Improved link.py error handling

Also completed link selecting functionality - actually linking to notes
still needs to be completed.