add forkHandler. closes #680

Also fix import warnings in Handler

The generalization of type here is a little tricky, please review it.