Improves study entry handling.
Cleans up utils and adds some tests.