Add tests
Bug fix
Add generic operations; reorganize files