clean up clang static analysis warnings

Reviewer: trivial

These were mosly just dead code. AIM_OBJECT_INIT had an unnecessary check of 
whether the object was NULL, which caused clang to think that the object could 
possibly be NULL, which resulted in a couple of spurious warnings in the 
callers.