Jasmine tests of validation utility

Includes a modification of validation logic which performs min and max length checks on optional fields in addition to required fields.
Merge pull request #5877 from edx/renzo/test-validation-utility

Jasmine tests of validation utility
Move redirection/enrollment to AccessView and trigger it using an event.

Ensure window.isExternal is loaded

Don't set a default for terms of service

For paid courses, add the course to the cart and redirect to the shopping cart view.

Don't send form method and url as form data.

Stub window.analytics in the access view test.