Circuit design

Still need to lay out the PCB, but here it goes.

/cc @sshirokov