Mira changes. Manually applied Eva's patch
Merge github.com:moses-smt/mosesdecoder into hieu_opt_input