Use funcionality of Input::Factory in fields.

- add static variables for registration of descendants.
- use factory in FieldAlgorithmBase::function_factory method.