Added threading tests and docs.