#15 implement tlen_binned; change missing value from NA to 0 for better compatibility when loading arrays; some refactoring