initial commit based on araddon's code, upgraded to latest thrift