Fix for subprocess call if the environment variable EDITOR has arguments (eg for textmate,  EDITOR=/usr/local/bin/mate -w )
Replaced split with shlex.split
Amended the file path derivation from permalink so it handles paths which end in a file extension