Mock framework and simple testing infrastructure

@juberti @andresusanopinto @vrk 
Missing copyright headers.