[scala] Self-contained build for scala examples

This closes #199.
[FLINK-1218] Replace new Integer with Integer.valueOf in tests

This closes #183.