Separate duration calculation from calc_dwells1.

Add underscores to functions meant to be used by internal class functions.
Change "dur" field in dwells1 datastructure to "duration".
Make minor PEP8 changes.

With the exception of the duration field change, all commits to this date should be backwards compatible.

Signed-off-by: Matthew Dahmer <matthew.dahmer@gmail.com>