Initial commit with all operations working

Some work required for the next few days.