Generalize sizes
Add test suite
Fix parsing and misc clean up