improve ToDId type class

make ToDId type class more flexible, such that it will accept any type that is viewable as a Long