Larger cleanup to input-related source files (this time using unique_ptr).

I took delroth's suggestion of using unique_ptr as well. However this required changes outside of InputComment to be done, and thus warranted it's own new branch.

This is open at the same time as PR #17 in case this one proves to be too messy (by opinion of course), then this one can be dropped and PR #17 can be used instead.

Anyway, feel free to point out anything that seems weird.