Render events on separate threads, using a pthread pool

*FOR DISCUSSION ONLY* right now, but hopefully rather close to being squash-and-merge-ready.
TODO:
- [ ] Add CPU count detection
- [ ] Valgrind the shit out of everything
- [ ] Deal with fribidi being non-thread-safe
 - Switch to minibidi?
 - Make people compile fribidi with `--enable-malloc`?
 - Put a mutex on fribidi?
- [ ] Figure out exactly how Windows support will work