Refactor ToStatement

Move ToStatement trait and provided conversions in separate file, refactoring conversions to avoid at most untyped parameter setter (`setAny`) + specs and doc.