Remove unused code and merge code from py-source-sdk-2013