Add Class#isEnum and improve error handling in Enum.valueOf