Regenerate prompt as needed

Move functionality to helpers where possible
Get rid of COMPILED_DIR variable

Makes prompts easier to test
Use a temp compiled dir for tests

Delete it after the test finishes