Bugfixes and cleanup.
Some buggy draft.
Fixed bug on killing process prematurely + cleanup.
Added testgen from Facebook.