what did barack obama do before he became a president?