Issue 517: initial commit

Created interfaces/classes/tests for issue 517. Please review it.