Fixes to CIP migration.

* Make query to get existing attachments for old CIP work by adding a
name class method.
* Remove redundant hard-coded name.
* Use org.build_corporate_information page methods.
* Fix use of wrong variable in attachment creation code, create relevant
attachment type from existing class.
* Add down method.
Better assertion in functional test.
Move CIP conversion code to lib, add tests.