Revert "Revert "Temporary commit""

This reverts commit b7e8e6d6d6156bfb6e05533f535e6e5810d731ed.
Get rid of entities_count
Move some classes around
Begin to introduce a more flexible system
Minor fix
Add licensing information
Mainly cosmetic changes