Rework of TypeExtractor for SAM support [FLINK-701]

In order to support Java 8 Lambdas the TypeExtractor has been adapted to support interface instead of classes as function bases.

See also [FLINK-701].

This PR also fixes a bug in the input validation for the new POJO types. I have reordered some methods and introduced some sections to improve code readability.

All old tests and code still work.