Rewrite tests with ert

And 'dont-compile' is obsoleted from Emacs 24.4.