refactor: add Key module, add Fragment class

* use html_safe instead of raw
* remove raw mock