Major action refactoring, tested all the corner cases and added error handling, split power functions outside the buildvApp / destroy actions.