improve port detection code
always use a top-level REPL for leiningen commands
use a persistent session when in quick repl mode