Flexibly Nested Production Functions: Implementation for MONASH