Squish: Moved code from aptw.py to build_utils

Change-Id: Id42cc45e9cb4a8a3aa43086ae3a427143617927c
Reviewed-by: Christian Stenger <christian.stenger@digia.com>