Improve program memory abstraction.

Now works for Arduino DUE as well.