Add inital wpdb calls and checks

Stopped right before tweaking AJAX game - everything looks like it
works.
Update same as last commit