Added support for preamble when running code locally.