Adds obligatory id logic and more tests.