Add EventQueue and refactor router frontend to use client/cache

I suppose it might be helpful to comment to that effect in the code.