Initial version. Much is copied from the functions file of the theme, but parts are changed and improved.