Clean up werkzeug process detection, add serve start and stop hooks

Fixes #185