Make prelude even shorter.

Move the domain-sniffing stuff to domain-implementation.js, and use lodash's `_.range` instead of writing our own.