Large Deviation Functional of the Weakly Asymmetric Exclusion Process