I'm thinking about going to Morocco, and I would be avoiding the most touristic places. 

I was wondering, what currency should I take with me. Would it be easy to exchange US dollars or Euro, and which should be more popular? Or maybe I should exchange money before and just bring Morrocan dirhams with me?

What about availability of ATMs in the country - outside of major cities like Casablanca and Marrakesh?