Implement AJAX call properly and portably.

Using the method described here: http://codex.wordpress.org/AJAX_in_Plugins and the wp_localize_script() "hack".