Add protocol preference

This switches the network protocol (stratum/http) to being its own
preference rather than part of the server string. It also switches the main
call into the native CPU miner code to returning an int so that in the
future we can detect configuration errors (although these currently just
call exit).