re-factoring

* bws-link-buffer is re-factored to be much clear, some stuff is moved
  out to separate routine
* bws-proj-scan-entries is fixed (duplicate entry bug, incorrect
  parent project matching)
* buf-ws-sort is simplified