I have written a small library based on the work by AlexT (https://github.com/tzapu). (I hope it's ok to post this here).
This is a complete rewrite which holds all html/js/css in ram and uses AJAX requests to communicate with the server. It is VERY easy to use Simply add two additional lines in your setup function, and you have a captive portal for when you want to connect your ESP to an unknown Wifi-network.
You can try it out at https://github.com/DKfraDK/ESP8266WiFiSetup