Relational Action Bases: Formalization, Effective Safety Verification, and Invariants (Extended Version)