Updated initializers to use instancetype instead of id.
Used unsigned integers for IDs and counts where possible.
Updated constants to use static variables instead of defines.