Basic proof of concept
Requires major refactoring to be maintainable
