Hardware unit test

@icbat Here's that metaclassing I told you about. :) Lemme know what you think.

<!---
@huboard:{"order":1.5,"milestone_order":16,"custom_state":""}
-->

Basically, the wizard waves his wand, and the code dances.

Seriously though, the __metaclass__ is basically a thing that all objects have on them that serves as a registry for where attributes/methods are, and what should be invoked. So by overriding/adding to the meta class you can add hooks in to do tasks on method/attribute access. 

A common use case of this is to add logging to web server. You can add a log message to every time an endpoint is called without adding a bunch of duplicated code to ever endpoint call.

Another common use case is to handle instances where methods don't exist. In python `__getattr__` is called every time a matching attribute cannot be found, and `__getattribute__` (used here) is called every time an attribute is accessed. There is no distinction between methods, and attributes in python except for the presence of `__call__` and for `@classmethod`s the __func__ attribute.

So basically what is going on here is, I'm adding a hook into the meta class registry to increment a reference counter every time a method is called on `MockGPIO` and also capture the args so that I can assert stuff in the unit tests.  

Did you have any questions that I didn't answer sufficiently?