added test framework
added tests
added build
corrected ternary
changed regexes, added tests and docs