Use properties instead of magic getter for ID.
Added tests.