Efficiency improvements, and method to update 'intervals' table in database
Added 'intervals' table to database to store animation data.