A new approach to string quantization in curved spacetimes