Better proximity algorithm with no magic numbers

Also, add dotslate.js to the repo for easy installation on a machine
with no CoffeeScript compiler.