Rearrange directories and add test framework