Fix build script to respect directories

The build script now creates directories properly, so that
all internal references actually work.

Jira issue: APPPOL-18
Merge pull request #3 from jplyle/APPPOL-18-Fix-Scripts

Fix build script to respect directories