Uploading sketch to ESP8266
Following on from user1637451 the following sequence has always worked for me: 


Before download, pull both GPIO0 and RST to ground.
Release the pull down on RST, but keep GPIO0 low.
When the IDE has finished downloading, release GPIO0 from low. 


I usually have pull-up resistors (10K) on both RST and GPIO0. 

As to the IDE problem. I used the tutorial from Sparkfun entitled "ESP8266 Thing Hookup Guide" and then the section "Installing the ESP8266 Arduino Addon". Because I used a different ESP8266 board to them I set the IDE to use the "generic ESP8266 board". This worked for me.