Add documentation, improve tests [MJ-315]