Add instructions for building from git
Use jd_alloc() and jd_free() for thread-local storage
Account for TLS in leaked memory during tests