Completion: move the code so the prototype is not needed

Just move the class_init() function below constructed(). The diff is
quite ugly, so it is in a separate commit.