mmhandle is now going to be a handles object so that it can be accessed by timer callbacks

This also means that some, and eventually all, of the core functions
have been modified.