There are wifi commands that can be used in a program to turn on station mode or ap mode.
connect "network Name" "network password"
will connect you to a wifi network in code.
ap "network name" "optional password"
Will create an access point from the esp.
See http://www.esp8266basic.com/wifi-commands.html in the language reference section of the esp8266 basic site.
http://esp8266basic.com
A BASIC interpreter for your ESP
Working now on Autodrop3d. A 3d printer with automatic part ejection system. https://autodrop3d.com