all: rewrote link algorithm, comments, Clang bugfix

Just need to finish the link calculation function later today, do tweaks the next 2 days, test and release on Wednesday. I've confirmed it works on Ubuntu 14.04, except for the PDB reader which got fixed with this commit. Will use a Fedora 20 next time.