Add component concept.

This commit adds the concept of a ComponentType, ComponentInstance
as well as ComponentLibrary. A ComponentType contains the basic
information about something that can be placed in a LogikSim circuit.
The most important part of that is a GUID uniquely identifying this
component.

A ComponentInstance can be instantiated using the ComponentType and
and contains additional instance specific meta-data. It is also the
actual class instance participating in the simulation. A ComponentInstance
always contains a reference to its ComponentType. A meta-data lookup
using get_metadata_field always first checks whether the field is available
in the instance before falling back to the ComponentType.

The ComponentLibrary is used to keep track of the different
ComponentTypes in the application and can be used to enumerate and
instantiate them.

All in all this machinery is supposed to enable the GUI to talk about
components to the backend without needing any strong coupling. GUI
specific attributes can be saved in additional meta-data fields on
instance or type the core doesn't have to look at. It also enables user
created components by making the uniquely identifiable and defining
a common way of creating them for the GUI.
Integrate some review feedback
Expand on meta-data concept.

- Added parent child relationship with hierarchical
  propagation of meta-data changes. This allows
  compound or other parent elements to filter the
  updates sent by its child elements.
- Added core interface for talking to Core from other
  processes by using multiprocessing queues.
- Updated tests and made them use the new interface.

Lots of todos an annoying complexities:
- How to gen IDs for sub-components
- How to implement lazy metadata
- How to handle rate-limiting
- How to properly draw abstraction boundaries
- How to handle backend <-> frontend item relationship
...
Some todos resolved. Some stuff cleared up.

- Introducing destruct method for components.
- Introduced tracking of component children so they
  can be destroyed with their parent element.
Added controller and interface concept.

To keep the core simple the actual simulation control
is now implemented in a Controller class.

To interface with the controller from outside of
the process the Interface class was added.
Add basic controller test coverage and fix some small issues.
Add handler class and switch to multiprocessing queue.

Annoyingly multiprocessing.Queue is really slow to mark
a queue as non-empty after put. The issue is mentioned on
https://docs.python.org/3/library/multiprocessing.html#pipes-and-queues .
Start integrating backend with frontend.

Currently non-functional. Not using multiprocessing module for now either
as it makes things needlessly complicated. Using python thread instead.

Basically all this commit is for is to get a feel for the pain points
in integration and to get a better idea on how to change the current item
creation to make it mesh seamlessly with what the backend is doing.

Added basic logging (might break later with multiprocessing).
Back to front process kinda starting to work.

- Added frontend item-registry which keeps track of
  available GUI item types and handles update messages
  from the backend. This includes creation, update and
  destruction of frontend items.
- Added GUI-GUID concept which allows a backend element
  to specify an override for what front-end item should
  be instantiated for it. This allows the same front-end
  class to service multiple different backend types which
  only differ in their meta-data. For example AND, OR, XOR
  don't need different UI logic just a different label.
- Added connected method to Element class which allows
  elements to be notified when something is connected to
  their inputs. This is important to be able to completely
  disconnect the element when destroying it.
Merge branch 'simulation' and fix integration issues.

Merge current state of my branch to be able to iterate
on it in trunk so we don't create incompatible constructs.

At this stage interaction with the frontend is limited to
AND item creation and the provisions for more.

Also lacking unit-test coverage in many important areas
of this merge.
Fix or workaround unit test failures and hangs.

Not sure why but PySide objects don't seem to get properly
cleaned up. Probably some issue with the GC and Qt's object
management not interacting correctly. This wouldn't be a
big problem in the tests but results in threads not being
properly joined on exit making test execution hang or even
crash depending on what the tread is doing when it is
forcefully terminated.

Everything seems to be fine in the main application but I
wasn't able to make it work in the unit tests. For now
the workaround is to manually join the threads in the
unit tests tear down function. Still hoping to figure out
a real solution instead of having to introduce a separate
function for telling stuff it's supposed to have been
"destroyed" by now.

Additionally quite a few tests created a GridScene GUI widget
without making sure we had an initialized Qt gui application
object to work with. This only worked because other unit tests
that happened to run beforehand created one.
Merge branch 'simu-merge'

Conflicts:
	src/logicitems/resizable_item.py