Modified problem file generation for unit tests

Removed hard-coded method of generating correct problem files in favour
of using Problem()'s solution property; generalized file generation
function