Connected write/refresh buttons to their proper slots
Some comment and general code cleanup tasks