Add tsort

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>

----

v1 (https://github.com/uutils/coreutils/pull/359) -> v2

- Reviewed by Arcterus
- fix and refactor
- performance improved (nearly double)