Added better support and tests for keyframes