QT5 fixes

Updates to fix Qt 5.0 vs Qt 4.0 compatibility issues
- Added package deployment code for OSX
- Replaced “loop” variable with “LOOP” to fix Qt 5.0 conflict