Refactor prototype to improve modularity
Execute testcases in separate threads

Timeout a thread after 5,000 milliseconds.
Correct the logic to timeout a worker thread.

Before timeout is only set on the future. Future.get() will return
after the timeout, but the worker thread may be running forever.

The current logic is to submit a terminator thread after the timeout to
cancel the future. As scheduledExecutorService uses a threadpool, terminated
thread would get replenished.
Revert "Correct the logic to timeout a worker thread."

This reverts commit 8b6b9379049b95d5d56399f8547952b4d3e77e2c.
Fix an errnous test case