Rewrite some functions for ELPA to avoid package control blow up.