merged master and tom oauth branch