Added a function to calculate sleep bout stuff

The function finds consecutive number chains and calculate their chain
lengths