TreeCoder: Systematic Exploration and Optimisation of Decoding and Constraints for LLM Code Generation