Give feature_def a constructor.

And clean up a little code.