Cleaned up the imlib manager and documented it more carefully.