Added compile_to method that with single .compile() can produce multiple target files.

This is my take on issues/568.
What do you think?
These should not be const refs. If the constructor is called in a way that constructs a temporary std::string, this is going to crash. It also adds a surprising lifetime/ownership issue.