Refactoring. Adding libuv tests. Reintroduced old set_rates et al for now.