Replace request channel with functions and mutexes

I should have gone with mutexes to begin with.