#40 refactoring for Cost Functions (and tests); small refactoring for hadoop examples; adding HadoopStarterExample