IDE-1229

Please see the notes of  different commits.