[DF-1213] Major implementation. Implemented features described in comments.