First try at pull request

turned some macros into constants
changed return types to void in some methods
added simple comparison functions and btree index for them