bring back trim_trailing_whitespace and insert_final_newline support

This brings back end_of_line, trim_trailing_whitespace and insert_final_newline support. I would however postpone merging it until we publish new version with exception fixes and new java core