Broaden localhost checking

* Broaden the check introduced in 229975d to account for
"localhost.localdomain" patterns.

Perhaps `isPrefixOf "localhost"` would be desireable, instead?

* Only bind to the localhost interface from REPL network socket.
Copied 'n pasted impl of
http://hackage.haskell.org/package/network-2.2.1.7/docs/Network.html#v:listenOn
modified to listen on localhost instead of iNADDR_ANY

Tested w/ netcat that I can connect when `host` is "localhost.localdomain", and that I can't when I try a non-127.0.0.1 interface on my local computer.