Move PreferencesPanel constructor logic to reload_data method.

I have figure out that PreferencesPanel constructor is not being
called when the UI is created from the UI template. So I have moved
the constructor logic to other function and call this function from
window class.

This fixes #28.