mysql-powered functional entity system