Initial check-in of codebase

Very alpha, not ready for use quite yet :)