First bits of an API
Remove the last few occurrences of mysql_ function usage.