Improved string splitting method that uses strtok (superior)