Amazon, California reach agreement in sales tax battle