setup slave to set_rw, allow usage as a script
continue to use master connection for SELECTs if all is read-only
fix some stylistic things
simplify further
update comments