All costs of such proceeding prior to and including the judgment and decree of the court, or, if the matter be referred, prior to and including the filing and approval of the referee’s report, shall be paid by the petitioner, and the court, as to all costs made subsequent thereto, shall make such order as in its discretion may be deemed just.