Adds a demo app and sizing tests. More refactoring and fixing bugs.