improved repeatframetitle; added hooks…

… beforebreak, afterbreak; changed internal calculation to reduce the
code.