How do I change the path that is being searched for launching an application?
To answer your question, your PATH has to be modified to:

PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/opt/X11/bin:/usr/texbin


so that your shell will find
    /usr/bin/dmd
before any other one called from within one of the 2 Python library directories.

Please note: it is a dangerous practice to let any software not distributed by Apple to install anything within /usr/bin (or /bin, /sbin or /usr/sbin). This is a technic used by crapware to hide themself.