use sha1, hmac and choice from pycrypto
fix oauth_nonce generation
remove inefficient function
fix rest api