refactors build script to use proper recursion for directory traversal
and maintaining the parentTemplate variable.

relying on the os.walk generator was incorrect, and only happened
to work for the current directory structure (but not on the vps).