[utils] Create a base class for Storage and CodeStorage

They share some logic and use so avoid code duplication and
hidden missing pieces.

Fixes #23
3 jobs for 23_clean_storage_classes in 9 minutes and 29 seconds (queued for 7 seconds)