I would suggest backing up your Pi and installing the latest official raspbian image from scratch. Do an upgrade and firmware upgrade. The reason I suggest it because it has wpa-supplicant pre installed and all you need to do is add 3 or 4 lines in to the supplicant file.
This is different because the interfaces file uses wpa-roam. Thanks to that line if you loose connection wpa-supplicant will try to reconnect to the next access point in the file. If there is only one it will try to reconnect to that one only.
I was messing about for weeks with an old image that was upgraded and had lots of rubbish. COnnection was dropping out all the time and it was driving me mad. I put on the latest image and my wifi is stable now. I could not run for an hour or more -with the new install it is going for over 24hours now. I am not sure how many times it reconnects but I know it is connected the whole time now.
iface lo inet loopback
iface eth0 inet dhcp
iface wlan0 inet manual
iface default inet dhcp
The supplicant file
Proto: WPA is WPA1. RSN is WPA2. If you leave both supplicant will figure out which one but if you dont specify one in there it wont automatically detect and use it.
pairwise: CCMP is AES counted. TKIP is WPA2 key manager. Again if you leave both supplicant will choose the correct one.
key_mgmt: will always be WPA-PSK for home routers. If you have a private key router this will be different and you will know what to put there.