Moved some stuff around, made things DRYer, and made things make a little more sense. Also made self link more reliable.