RFC/WIP: Move more of jl_uv into julia code

/cc @vtjnash 

I'm pretty sure that this breaks the REPL on windows, which is why I didn't push it to master. Anyway, I'm working to replace readline in the REPL anyway, so that shouldn't be an issue soon. 

I have a couple more changes in the works that build on this, which I'll push to this branch soon.

This helps #2816