Changes return value of id to instancetype

Uses the `instancetype` instead of vague `id`so that the Swift compiler can use these methods without ugly downcasting.