Add method to get optimized plan from LocalExecutor

After reading @sscdotopen's comment in #128, I figured it might be worthwhile to add the option to get the optimized plan from the `LocalExecutor`.

This commit adds a static method which returns the optimized plan as a String (in JSON). We could also add the `PrintWriter`/`FileWriter` versions from the dump generator, but the String version should be fine for now.