Update build script logic. Clearer handling of installed version of WP