Added code for most of skeleton functions, couple of todos, plus all the
test code.