Tools for general maximum likelihood estimation