Bugfixes that let ca/ca pass tests. Added transf_by_grids.cpp. Re-used old io handling. Convert does not compile yet.