Update build.xml to detect composer bin better

Add a target for detecting the composer bin path, which reduces duplication of
code for targets that depend on it.

Update to also allow composer.phar file to be called 'composer' on the system
or user PATH.