Added docstring and more unit tests for resample() and length().
Fixed missing parenthesis in metrics.py