adds logic to finalize tracks and check for finalization

Finalization is checked in adding or deleting tracks, which can only be done before tracks are finalized.

This adds the view to finalize tracks and updates other views to interact with track finalization.

Also, old database interaction is removed.