Use async_nif to avoid scheduler issues

This request includes many changes and has been tested running in basho_bench.