Added memory API, updated register implementation