THRIFT-2692 compiler refactor

https://issues.apache.org/jira/browse/THRIFT-2692